import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class PayBillItem extends StatelessWidget {
  final String assertPath;
  final String title;
  final VoidCallback onTap;
  final bool isSelect;

  const PayBillItem(
      {Key key, this.isSelect, this.assertPath, this.title, this.onTap})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      padding: EdgeInsets.symmetric(horizontal: getDp(22), vertical: getDp(21)),
      color: isSelect == true ? aceLightBlue : Colors.white,
      borderRadius: BorderRadius.circular(getDp(10)),
      border: isSelect == true
          ? Border.all(
              color: aceBlueColor,
              width: getDp(1),
            )
          : null,
      boxShadow: [
        BoxShadow(
          offset: Offset(0.0, getDp(4)),
          blurRadius: getDp(22),
          spreadRadius: -getDp(4),
          color: Colors.black.withOpacity(0.25),
        ),
      ],
      onPressed: onTap,
      child: Row(
        children: [
          assertPath.endsWith('.svg')
              ? SvgPicture.asset(
                  assertPath,
                  width: getDp(21),
                  height: getDp(25),
                )
              : Image.network(
                  assertPath,
                  width: getDp(21),
                  height: getDp(25),
                ),
          SizedBox(
            width: getDp(27),
          ),
          Expanded(
            child: Text(
              title,
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(16),
                fontWeight:
                    isSelect == true ? FontWeight.w700 : FontWeight.w400,
                height: 22 / 16,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
